/*
 * @(#)JasyptTextEncryptor.java 1.0 2019年10月30日上午11:26:47
 *
 * Saturn Framework Co.Limt
 * Copyright (c) 2012-2019 tanks, Inc. All rights reserved.
 */
package com.saturn.cloud.config;

import org.jasypt.encryption.StringEncryptor;

/**
 * <dl>
 *    <dt><b>Title:</b></dt>
 *    <dd>
 *    	none
 *    </dd>
 *    <dt><b>Description:</b></dt>
 *    <dd>
 *    	<p>none
 *    </dd>
 * </dl>
 *
 * @author tanks
 * @version 1.0, 2019年10月30日
 * @since satrun-config-spring-cloud-starter
 * 
 */

public class JasyptTextEncryptor implements org.springframework.security.crypto.encrypt.TextEncryptor{

	private StringEncryptor stringEncryptor;
	
	public JasyptTextEncryptor(StringEncryptor stringEncryptor) {
		this.stringEncryptor = stringEncryptor;
	}
	
	@Override
	public String encrypt(String text) {
		return stringEncryptor.encrypt(text);
	}

	@Override
	public String decrypt(String encryptedText) {
		return stringEncryptor.decrypt(encryptedText);
	}

}
